package custom.security.core.validate.code;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 默认的验证码实体类，即短信验证码
 * Created by wgt on 2017/10/14.
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DefaultValidateCode {

    private String code;
    private LocalDateTime expireTime;

    /**
     * 构造设定过期的时长
     * @param code
     * @param InExpire  过期的时长  单位 秒(s)
     */
    public DefaultValidateCode(String code, int InExpire) {
        this.code = code;
        this.expireTime = LocalDateTime.now().plusSeconds(InExpire);
    }
}
